-- GENERATED SPELL FOR [Red Wyrmkin] --


function spell0_1046(pUnit, Event) --@Arcane Bolt,n/a--
pUnit:FullCastSpellOnTarget(15230,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_1046', 1000, 1)
end

function spell1_1046(pUnit, Event) --@Fire Blast,n/a--
pUnit:FullCastSpellOnTarget(14145,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_1046', 628, 1)
end

function spell2_1046(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(15242,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_1046', 3000, 1)
end

function spell3_1046(pUnit, Event) --@Flamestrike,n/a--
pUnit:FullCastSpellOnTarget(18399,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_1046', 11000, 1)
end

function Sorts_1046(pUnit, Event)
local choix_sorts_1046 = math.random(0, 3)
if choix_sorts_1046 == 0 then
pUnit:RegisterEvent('spell0_1046', 1, 1)
end
if choix_sorts_1046 == 1 then
pUnit:RegisterEvent('spell1_1046', 1, 1)
end
if choix_sorts_1046 == 2 then
pUnit:RegisterEvent('spell2_1046', 1, 1)
end
if choix_sorts_1046 == 3 then
pUnit:RegisterEvent('spell3_1046', 1, 1)
end
end

function mob1046_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_1046', math.random(1500, 3000), 1)
end

function mob1046_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob1046_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob1046_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(1046, 1, 'mob1046_Action')
RegisterUnitEvent(1046, 2, 'mob1046_Leave')
RegisterUnitEvent(1046, 3, 'mob1046_Kill')
RegisterUnitEvent(1046, 4, 'mob1046_Die')
